package com.exmaple.baidumv.comm;

import java.util.Map;

import android.content.Context;

import com.yuelan.codelib.utils.DensityUtil;
import com.yuelan.codelib.utils.MyHashMap;
import com.yuelan.codelib.utils.NetWorkUtil;
import com.yuelan.codelib.utils.PhoneUtil;
import com.yuelan.codelib.utils.VersionUtil;

public class App {
	public static int getIdByName(Context context, String className, String name) {
		return context.getResources().getIdentifier(name, className,
				context.getPackageName());
	}

	public static Map<String, String> getUserBaseDeviceInfo(Context c) {
		MyHashMap<String, String> maps = new MyHashMap<String, String>();
		maps.put("osVersion", PhoneUtil.getAndroidVersion());
		maps.put("imei", PhoneUtil.getIMEI(c));
		maps.put("deviceNo", PhoneUtil.getOnlyPhoneId(c));
		maps.put("androidId", PhoneUtil.getDeviceId(c));
		maps.put("screenh", DensityUtil.getScreenHeight(c) + "");
		maps.put("screenw", DensityUtil.getScreenWidth(c) + "");
		maps.put("deviceManufacturer", PhoneUtil.getMobileManufacturer());
		maps.put("deviceType", PhoneUtil.getDeviceType());
		maps.put("netConnectionType", NetWorkUtil.getNetWork(c));
		maps.put("imsi", PhoneUtil.getIMSI(c));
		maps.put("packageName", c.getPackageName());
		// maps.put("channelId", getAppChannel(c));
		// maps.put("appId", getAppID(c) + "");
		maps.put("appVersionName", VersionUtil.getVerName(c));
		maps.put("appVersionCode", VersionUtil.getVerCode(c) + "");
		// maps.put("ourVersion", ConFigFile.Our_VerSion);
		return maps;
	}
}
